﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;

namespace Demo
{
    public partial class Colors : Form
    {
        public Colors()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.ResizeRedraw, true);
        }

        private void Colors_Paint(object sender, PaintEventArgs e)
        {
            using (Graphics graphics = this.CreateGraphics())
            {
                Brush brush = new SolidBrush(Color.FromKnownColor(KnownColor.ActiveBorder));
                graphics.FillEllipse(brush, this.ClientRectangle);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (Graphics graphics = this.CreateGraphics())
            {
                Color aliceBlue = Color.FromArgb( Color.AliceBlue.A / 2,  Color.AliceBlue.R,  Color.AliceBlue.G,  Color.AliceBlue.B);
                Brush brush = new SolidBrush(aliceBlue);

                graphics.FillRectangle(brush, this.ClientRectangle);
            }
        }
    }
}
